package com.hu.video.mapper;

import com.hu.video.entity.VideoWhitelist;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface VideoWhitelistMapper {
    @Select("SELECT * FROM video_whitelist WHERE video_id = #{videoId}")
    List<VideoWhitelist> selectByVideoId(Long videoId);

    @Insert("INSERT INTO video_whitelist (video_id, allowed_user_id, create_time) VALUES (#{videoId}, #{allowedUserId}, NOW())")
    int insert(VideoWhitelist whitelist);

    @Delete("DELETE FROM video_whitelist WHERE video_id = #{videoId} AND allowed_user_id = #{allowedUserId}")
    int delete(VideoWhitelist whitelist);
} 